package aryn.framework.graphic;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.Raster;

public class ImageUtility {

	public boolean compare(Image image1, Image image2) {
		BufferedImage img1 = (BufferedImage) image1;
		BufferedImage img2 = (BufferedImage) image2;
		Raster r1 = img1.getData();
		Raster r2 = img2.getData();
		DataBuffer db1 = r1.getDataBuffer();
		DataBuffer db2 = r2.getDataBuffer();
		int size1 = db1.getSize();
		int size2 = db2.getSize();
		if (size1 == size2) return true;
		return false;
	}
}
